package com.fyzk.activity.zhifu;

import com.fyzk.activity.lottery.basketball.JCLQFragmentActivityI;
import com.fyzk.activity.lottery.basketball.JCLQPayActivity;
import com.fyzk.activity.lottery.jc.football.guoguan.JC_GuoGuanDialog;
import com.fyzk.activity.lottery.jc.football.guoguan.JC_GuoGuanInfor;
import com.fyzk.adapter.JCLQDXFPayAdapter;
import com.fyzk.model.JCLQMatchData;
import com.fyzk.utils.IntentParamUtils;

import java.util.List;

/**
 * 竞彩篮球胜负投注类
 */
public class JCLQDXFPayActivity extends JCLQPayActivity {


    @Override
    protected void setAdapter() {
        // TODO Auto-generated method stub
        isDanguan = getIntent().getBooleanExtra(IntentParamUtils.TYPE_GUOGUAN, false);
        adapter = new JCLQDXFPayAdapter(this, isDanguan,
                jcInfors, handler, this);
        listView.setAdapter(adapter);
    }

    @Override
    protected String getContent() {
        List<String> chuans = JC_GuoGuanInfor.getChuanIds(JC_GuoGuanDialog.result, isDanguan);
        String content = "";
        for (int i = 0; i < chuans.size(); i++) {
            content += lotteryId + "" + wanFa + chuans.get(i) + "-";// 301012001-
            String n = "";
            for (int j = 0; j < JCLQFragmentActivityI.matchs.size(); j++) {
                JCLQMatchData info = JCLQFragmentActivityI.matchs.get(j);
                StringBuffer danChang = new StringBuffer();
                JCLQMatchData.SPInfo sp_d = info.splInfos.get(info.DXF_1);
                JCLQMatchData.SPInfo sp_x = info.splInfos.get(info.DXF_2);

                if (info.clickNum>0) {
                    danChang.append(info.getMatchNum());
                    danChang.append("(");
                    if (sp_d.isSel) {
                        danChang.append("1,");
                    }
                    if (sp_x.isSel) {
                        danChang.append("2,");
                    }
                    danChang.deleteCharAt(danChang.length()-1);
                    danChang .append(")");
                }

                if (!danChang.toString().equals("")) {
                    n += danChang + "|";
                }
            }
            if (!n.equals("")) {
                n = n.substring(0, n.length() - 1);
                n += "^";
            }

            content += n + "!";
        }

        if (!content.equals("")) {
            content = content.substring(0, content.length() - 1);
        }

        return content;
    }


}
